package com.linked.goods.goodsbase.bean.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.linked.goods.goodsbase.bean.dto.BaseGoodsDTO;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @author :dbq
 * @date : 2023/1/28 10:07
 * @description : desc
 */
@Data
@TableName("goods_goods_info")
public class GoodsInfoPO {

    @TableId(value = "goods_id", type = IdType.ASSIGN_UUID)
    private String goodsId;

    @TableField("shop_id")
    private String shopId;

    @TableField("goods_name")
    private String goodsName;

    @TableField("goods_price")
    private Double goodsPrice;

    @TableField("brand_code")
    private String brandCode;

    @TableField("goods_type")
    private String goodsType;

    @TableField("goods_order")
    private Integer goodsOrder;

    @TableField("on_shelves")
    private Integer onShelves;

    @TableField("create_time")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createTime;

    @TableField("data_status")
    private Integer dataStatus;

    public GoodsInfoPO() {
    }

    public GoodsInfoPO(BaseGoodsDTO param) {
        this.goodsName = param.getGoodsName();
        this.shopId = param.getShopId();
        this.goodsOrder = param.getGoodsOrder();
        this.goodsType = param.getGoodsType();
        this.onShelves = param.getOnShelves();
        this.goodsPrice = param.getGoodsPrice();
        this.brandCode = param.getBrandCode();
    }
}
